<?php
/* @var $this PurchaseController */
/* @var $model Purchase */
/* @var $invoice Invoice */
/* @var $customer Customer */
/* @var $address Address */
/* @var $dataProvider */
/* @var $filtersForm */
/* @var $form CActiveForm */
?>

<h2>Wein wählen:</h2>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'wine-form',
	'enableAjaxValidation'=>false,
)); ?>

	<?php $form=$this->beginWidget('CActiveForm', array(
	    'enableAjaxValidation'=>true,
	)); ?>
	 
	<?php 	
		$columns = array(
		    array(
		        'id'=>'wine_id',
		        'class'=>'CCheckBoxColumn',
		        'selectableRows' => '1',   
		    ),
		    array(
		        'header'=>CHtml::encode('ID'),
		        'name'=>'wine_id',
		    ),		    
		    array(
		        'header'=>CHtml::encode('Produktinformation'),
		        'name'=>'product_information',
		    ),
            array(
                'header'=>CHtml::encode('Winzer'),
                'name'=>'vint',
            ),
		    array(
		        'header'=>CHtml::encode('Istbest.'),
		        'name'=>'amount',
		    ),
            array(
                'header'=>CHtml::encode('EKP'),
                'name'=>'buying_price',
                'value'=>'Yii::app()->format->formatNumber($data->buying_price)',
            ),

		);
		 
		$this->widget('zii.widgets.grid.CGridView', array(
            'cssFile' => Yii::app()->getRequest()->getBaseUrl() . '/css/tableStyle_align_left.css',
		    'id'=>'wine-grid',
		    'dataProvider'=>$dataProvider,
		    'columns'=>$columns,
		    'filter'=>$filtersForm,
		));
	?>
	
	<div class="row">
		<?php echo $form->labelEx($model,'amount'); ?>
		<?php echo $form->textField($model,'amount'); ?>
		<?php echo $form->error($model,'amount'); ?>
	</div>

	
	<div class="row buttons">
		<?php echo CHtml::submitButton("Auswählen"); ?>
	</div>
	<?php $this->endWidget(); ?>

<?php $this->endWidget(); ?>

</div><!-- form -->